GH-50774: [CI][Python] Match Protobuf symbol visibility in bundled Substrait and ORC - #50792
Conversation
|
@github-actions crossbow submit test-conda-python-emscripten |
|
|
|
Revision: f5714c0 Submitted crossbow builds: ursacomputing/crossbow @ actions-50e51eced4
|
|
Although the first crossbow run failed with pre-existing ( While in the issue logs The log also shows the export is present in the wheel, meaning that the Locally I traced the cause (with fix reverted failure reproduced), symbolized by patching > await pyodide.loadPackage('/build/python/dist/pyarrow-26.0.0a0-cp312-cp312-pyemscripten_2024_0_wasm32.whl');
Loading pyarrow
ABORT: Error
at abort (/pyodide/pyodide.asm.js:10:6334)
at _abort (/pyodide/pyodide.asm.js:10:289408)
at invoke_v (/pyodide/pyodide.asm.js:10:1224993)
at wasm://wasm/0267d6e2:wasm-function[13105]:0x531c4b
at libarrow_python.so.google::protobuf::FileDescriptorProto::SharedDtor(google::protobuf::MessageLite&) (wasm://wasm/libarrow_python.so-0fa2ac3a:wasm-function[48283]:0x2517a8a)
at invoke_vi (/pyodide/pyodide.asm.js:10:1223725)
at libarrow_python.so.google::protobuf::FileDescriptorProto::~FileDescriptorProto() (wasm://wasm/libarrow_python.so-0fa2ac3a:wasm-function[48282]:0x2517795)
at libarrow_python.so.google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (wasm://wasm/libarrow_python.so-0fa2ac3a:wasm-function[48600]:0x2527cec)
at invoke_iiii (/pyodide/pyodide.asm.js:10:1223129)
at libarrow_python.so.google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*) (wasm://wasm/libarrow_python.so-0fa2ac3a:wasm-function[48861]:0x255572e)
Aborted()
Failed to load pyarrow
The following error occurred while loading pyarrow:
Aborted(). Build with -sASSERTIONS for more info.
[]The abort happens during static initialization of |
|
@github-actions crossbow submit test-conda-python-emscripten |
|
Revision: e44aaa2 Submitted crossbow builds: ursacomputing/crossbow @ actions-e7e0e9a62d
|
e44aaa2 to
a7d0931
Compare
|
@github-actions crossbow submit test-conda-python-emscripten r-recheck-most |
|
Revision: a7d0931 Submitted crossbow builds: ursacomputing/crossbow @ actions-c8b74835fc
|
|
@github-actions crossbow submit test-conda-python-emscripten |
|
Revision: 8d456b3 Submitted crossbow builds: ursacomputing/crossbow @ actions-6f85329ef0
|
|
@github-actions crossbow submit test-conda-python-emscripten |
|
Revision: 18130db Submitted crossbow builds: ursacomputing/crossbow @ actions-24de2ba338
|
|
|
||
| add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) | ||
| set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
| if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
There was a problem hiding this comment.
Can we remove this condition? (Can we always set CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN?)
|
BTW, can we always use |
| "-DZLIB_LIBRARY=$<TARGET_FILE:ZLIB::ZLIB>") | ||
| "-DZLIB_LIBRARY=$<TARGET_FILE:ZLIB::ZLIB>" | ||
| -DCMAKE_CXX_VISIBILITY_PRESET=hidden | ||
| -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON) |
There was a problem hiding this comment.
oh... those two lines are sorted now!
|
@github-actions crossbow submit test-conda-python-emscripten |
|
Revision: a95ac9f Submitted crossbow builds: ursacomputing/crossbow @ actions-578e2a8b50
|
|
@github-actions crossbow submit test-ubuntu-22.04-cpp test-debian-13-cpp-amd64 |
|
Revision: a95ac9f Submitted crossbow builds: ursacomputing/crossbow @ actions-ee064bc184
|
|
Thanks @kou , this is now ready for review |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit d6d8f03. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 30 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Fix #50774. After #50650, the Pyodide build failed while loading PyArrow with
ImportError: dynamic module does not define module export function (PyInit_lib).The ImportError is misleading because the
PyInit_libis present. The actual failure is an earlier abort during static initialization oflibarrow_python.so, in Protobuf descriptor registration.#50650 changed the order of libraries merged into
libarrow_bundled_dependencies.a. The archive contains duplicate weak Protobuf/Abseil symbols emitted by the Protobuf runtime and generated code in Substrait and in ORC. These symbols had inconsistent visibility:a) Protobuf was compiled with hidden visibility,
b) Substrait and ORC generated Protobuf code used default visibility,
so the order change caused
wasm-ldto select symbols with different visibility.(e.g.
google::protobuf::internal::ZeroFieldsBase::Clear()changed from hidden in Protobuf'sempty.pb.cc.oto default visible in Substrait'salgebra.pb.cc.o)The failure showed up in Emscripten, no failures on other platforms, but matching visibility globally is desirable to prevent any unintended exports and symbol interposition.
What changes are included in this PR?
Compile bundled Substrait and ORC with the same hidden visibility for symbols as Protobuf so not depending on archive order.
Also add debug for Emscripten CI builds
--profiling-funcs.Are these changes tested?
Yes,
test-conda-python-emscriptenpasses(Local repro, debug and fix verification with
ARCH=amd64 archery docker run conda-python-emscripten, for symbolsllvm-nmandwasm-ld)Are there any user-facing changes?
No.